<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, user-scalable=no, maximum-scale=1.0"/>
    <title>找回密码</title>
    <meta content="yes" name="apple-mobile-web-app-capable" />
    <meta content="black" name="apple-mobile-web-app-status-bar-style" />
    <meta content="telephone=no" name="format-detection" />
	<link href="../assets/mobile/login.css" rel="stylesheet" type="text/css" />
	<link rel="stylesheet" href="../assets/mobile/top.css">
    <link href="../assets/mobile/comm.css" rel="stylesheet" type="text/css" />
	<link href="../assets/mobile/member.css" rel="stylesheet" type="text/css" />
	<script src="../assets/js/mobile/jquery190.js" type="text/javascript"></script>
    <link rel="stylesheet" href="../assets/agile/css/ratchet/css/ratchet.min.css">
    <link rel="stylesheet" href="../assets/agile/css/flat/flat.component.css">
    <link rel="stylesheet" href="../assets/agile/css/flat/iconline.css">
<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript" src="../script/jquery.js"></script>
<script type="text/javascript" src="../script/jquery.form.js"></script>
<script type="text/javascript" src="../script/config.js"></script>
<script type="text/javascript" src="../script/local.js"></script>
<script type="text/javascript" src="../script/common.js"></script>
</head>
<body style="position:static !important;">
<div class="h5-1yyg-v11">
    
<!--通用顶部-->
<div id="ios-top-box">
    <div id="header" class="bar bar-nav">
    <div class="titlebar">
    <a href="javascript:appClose('findmobilecheck',api);"><i class="iconfont iconline-arrow-left"></i></a>
    <h1 class="title">验证手机</h1>
    </div>
    </div>
</div>
<!--通用顶部结束-->


<style>
.login_SendoutbutClick {
	background: #f60;
	border: 1px solid #F60;
	color: #fff;
	font-size: 12px;
	height: 25px;
	padding: 0 15px;
	border-radius: 2px;
}
</style>

        <section style="margin-top:44px;">
		<form action="" id="registerCon" enctype="application/x-www-form-urlencoded" method="post">
        <div class="registerCon">
	        <ul>
				<li>
					<p><span class="orange webname"></span>已向您的手机免费发送了一条验证短信，请查看您的手机短信！</p>
				</li>
				
				<li><input id="mobileCode" name="checkcode" type="text" placeholder="短信验证码" class="rText" ><s class="rs2"></s></li>
                <li><input type="submit" name="submit"  style="background:#c40c00;color:#FFFFFF" id="btnSubmitRegister" class="login_Email_but" value="提交验证" /></li>

				<li class="login_Explain">
				<h2 style="margin-top:20px;">没收到验证短信？</h2>
				<p>1.请查看手机的垃圾短信，信息有可能被误认为是垃圾信息。</p>
				<p>2.如果在2分钟后仍未收到验证短信，请点击 <a id="reSend" dis="2" style="border-radius:4px;background:#c40c00;border:1px solid #c40c00;color:#fff;padding:5px 10px;display:inline-block;">120秒后重新发送</a> </p>
				<p>3.如果手机号码不小心输错了或者想换个号码？请点击 <a id="hylinkRegisterPageA" class="blue Fb" href="javascript:randomSwitchBtn('register',api);">重新注册</a></p>
				</li>
			</ul>
        </div>
		</form>
        </section>
</div>

<script>
    $(function(){
        
        $('#registerCon').submit(function(){
            
            var mobileCode = $('#mobileCode').val();
            if(!mobileCode){
                $.PageDialog.fail('请输入短信验证码');
                return false;
            }
           var mobile = localData.get('mobile');
           api.showProgress({'title':'正在验证','text':''});
           $(this).ajaxSubmit({
               url : config.url+'/app.php?act=checkcode',
               dataType:'json',
               data : {
                   submit : true,
                   mobile:mobile,
                   mobileCode:mobileCode
               },
               success : function(data){
                   api.hideProgress();
                   if(data['status']){
                       //重置密码
                       localData.set('passcode',data['data']);
                       $.PageDialog.ok('<s></s>验证通过');
                       setTimeout(function(){
                           appClose('findpwd',api);
                           randomSwitchBtn('findsetpwd',api);
                           appClose('findmobilecheck',api);
                       },1200);
                   }else{
                       $.PageDialog.fail(data['msg']);
                   }
               }
           });
           return false;
        });
        
        function send(){
            $('#reSend').click(function(){
                if($(this).attr('dis') == 1){
                    $(this).text('正在发送');
                    count_time();
                    $(this).attr('dis',2);
                    var u = localData.get('mobile');
                    GetJPData(config.url+'/app.php?act=findsendmobile',{name:u},function(data){
                        if(data['status']){
                            $.PageDialog.ok('<s></s>'+data['msg']);
                        }else{
                            $.PageDialog.fail(data['msg']);
                        }
                    });
                }
            });
        }
    function count_time(){
        var i = 120;
        var senda=document.getElementById('reSend');
        var timer = setInterval(function(){
            if(i>0){
                senda.innerHTML = i+'秒后重新发送';
                i--;
            }else{
                senda.innerHTML = '重新发送';
                send();
                $('#reSend').attr('dis',1);
                clearInterval(timer);
            }
        },1000);
   }
   count_time();
 });
    GetJPData(config.url+'/app.php?act=getsite',{key:'web_name'},function(data){
        if(data['status']){
            $('.webname').text(data['data']);
        }
    });
    GetJPData(config.url+'/app.php'+localData.get('findmobilecheck'),{getuser:true},function(data){
        if(data['status']){
           localData.set('mobile',data['data']);
        }else{
            api.alert({msg:data['msg']},function(index,err){
                api.closeWin({name:'findmobilecheck'});
            });
        }
    });
    
</script>
</body>
</html>